import 'dart:async';
import 'dart:convert';

import 'package:flutter/material.dart';
import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart';
import 'package:video_player/video_player.dart';
// import 'package:video_player_control_panel/video_player_control_panel.dart';
import 'package:flutter_meedu_videoplayer/meedu_player.dart';

typedef void CallBack(String content, context);
class PngDialogBox extends StatefulWidget {
  final CallBack contentStrCallBack;
  final String  descriptions,name;
  const PngDialogBox({
    Key? key,
    required this.descriptions,
    required this.name,
    required this.contentStrCallBack
  }) : super(key: key);

  @override
  _CustomDialogBoxState createState() => _CustomDialogBoxState();
}

class _CustomDialogBoxState extends State<PngDialogBox> {
  @override
  Widget build(BuildContext context) {
    return contentBox(context
    );
  }

  contentBox(context) {
    return Container(
      width: 604,
      height: 328,
      decoration: BoxDecoration(
          color: Colors.white
      ),
        child: Column(
          children: [
            Container(
              height: 40,
              decoration: BoxDecoration(
                  color: Color(0xff3f8cff)
              ),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                crossAxisAlignment: CrossAxisAlignment.center ,
                children: [
                  Container(
                      margin:  EdgeInsets.only(left: 14),
                      child: widget.name=='无标题'?Container():Text(widget.name,style: TextStyle(color: Colors.white,fontSize: 16),)
                  ),
                  InkWell(
                    onTap: (){
                      // widget.contentStrCallBack('2',context);
                      Navigator.of(context)
                          .pop(context);
                    },
                    child:
                    Container(
                        margin:  EdgeInsets.only(right: 15),
                        child:   Image.asset(
                          'assets/images/close.png',
                          width: 26,
                          height: 26,
                        )
                    )
                    ,
                  )

                ],
              ),
            ),
            Expanded(
                child:
                SingleChildScrollView(
                  child:   Column(
                    children: [
                      Container(
                        margin: EdgeInsets.only(left: 20,right: 20,top: 20),
                        child:  Image.network( widget.descriptions,fit: BoxFit.contain)
                      )
                     ,
                    ],
                  )
                )

              ),


          ],
        )
  ,
    );
  }
}
